package com.znsd.zl.app.tenant.controller;

import com.znsd.zl.app.tenant.entity.DateEntity;
import com.znsd.zl.app.tenant.entity.TenantEntity;
import com.znsd.zl.app.tenant.service.ITenantService;
import com.znsd.zl.utils.BaseController;
import com.znsd.zl.utils.R;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName: TenantController
 * @Program: zlhouse-manage
 * @Description: 租客业务实现层
 * @Author: tangjun
 * @Date: 2020-08-23 23:59
 * @Version 1.0
 **/
@RestController
@RequestMapping("/user/tenant")
public class TenantController  extends BaseController<ITenantService, TenantEntity, Integer> {

	@Resource
	ITenantService iTenantService;

	/**
	 * @Author tangjun
	 * @Description 租客查询
	 * @Date  2020/8/24 0024
	 * @param dateEntity 时间条件
	 * @return 返回 R 类型
	 **/
	@RequestMapping("/query")
	public R fun(@RequestBody DateEntity dateEntity){
		//对返回的数据进行封装
		List<TenantEntity> list=iTenantService.monthQuery(dateEntity);
		System.out.println(list.toString());
		return R.ok().put("list",list);
	}
}
